AI Engineering Architecture

The simplest architecture

In its simplest form:

  1. an application receives a query
  2. sends it to the model API
  3. model generates a response
  4. response is returned to the user

More components can be added

1. Enhance context

Placed between query and model API: Enhance context input into a model by giving the model access to external data sources and tools

Quote

Context construction is like feature engineering for foundation models.

2. Put in guardrails

Placed at inputs and outputs: Guardrails help protect you and your users

3. Add model router and gateway

Placed inside the model: they support complex pipelines and add more security

4. Reduce latency and cost with caches

Placed inside the model: typically implemented by model API providers

5. Add agent patterns

Placed in a loop: the system's output may not be enough to accomplish the task so it starts another cycle (similar to Intelligent Agent)